package com.moli.iov.base.enums;

/**
 * 系统设置默认值
 *
 * @author whl
 */

public enum SysParamSettingEnum {
  SOC("1", 20, "1", "%"),
  LOW_VOLTAGE_V("2", 11, "2", "V"),
  OFFLINE_ALARM_DURATION("3", 72, "3", "小时"),
  IGNORE_ALARM_DURATION("4", 48, "3", "小时"),
  FENCE_ALARM_DURATION("5", 48, "3", "小时"),
  MILEAGE_ALARM_DURATION("6", 48, "3", "小时");


  SysParamSettingEnum(String dictCode, double defaultsValue, String unit, String unitName) {
    this.dictCode = dictCode;
    this.defaultsValue = defaultsValue;
    this.unit = unit;
    this.unitName = unitName;
  }


  /**
   * 字典code
   */
  private String dictCode;
  /**
   * 默认值
   */
  private double defaultsValue;
  /**
   * 单位(1%,2,V(伏特)3,小时hours)
   */
  private String unit;
  /**
   * 单位(1%,2,V(伏特)3,小时hours)
   */
  private String unitName;

  public String getDictCode() {
    return dictCode;
  }

  public void setDictCode(String dictCode) {
    this.dictCode = dictCode;
  }

  public double getDefaultsValue() {
    return defaultsValue;
  }

  public void setDefaultsValue(double defaultsValue) {
    this.defaultsValue = defaultsValue;
  }

  public String getUnit() {
    return unit;
  }

  public void setUnit(String unit) {
    this.unit = unit;
  }

  public String getUnitName() {
    return unitName;
  }

  public void setUnitName(String unitName) {
    this.unitName = unitName;
  }

  public static SysParamSettingEnum getSysParamSettingEnumByDictCode(String code) {
    for (SysParamSettingEnum e : SysParamSettingEnum.values()) {
      if (code.equals(e.getDictCode())) {
        return e;
      }
    }
    return null;
  }
}
